import 'package:bmprogresshud/progresshud.dart';
import 'package:flutter/cupertino.dart';

/*模态对话框扩展*/
extension ProgressHudExtension on ProgressHud {

  ///信息提示框
  ///@params String msg 消息
  ///@params BuildContext context 上下文
  static void showInfoDialog(String msg, BuildContext context) {
    ProgressHud.of(context)?.showAndDismiss(ProgressHudType.toast, msg);
  }

  ///失败信息提示框
  ///@params String msg 消息
  ///@params BuildContext context 上下文
  static void showErrorDialog(String msg, BuildContext context) {
    ProgressHud.of(context)?.showAndDismiss(ProgressHudType.error, msg);
  }

  ///成功信息提示框
  ///@params String msg 消息
  ///@params BuildContext context 上下文
  static void showSuccessDialog(String msg, BuildContext context) {
    ProgressHud.of(context)?.showAndDismiss(ProgressHudType.success, msg);
  }
}
